from apps.knowledge_fault_tree.models import FaultTree, Probability
from rest_framework import serializers


class FaultTreeSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = FaultTree
        fields = ('id', 'name', 'json')


class ProbabilitySerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Probability
        fields = ('id', 'target', 'targetid', 'probability', 'tree')